var WizredirToChat=""; var WizautoOpen=0; var WizcurrentToken = ""; var WizaccessibilityMode = ""; var WizSkipjQuery=(""=="") ? "" : WizSkipjQuery="1"; var WizsideBarPosition = 0; var WizuseSide="left"; var WizchatServerName= "https://WIZ.medone.idf.il/MT/"; var wizProfile = 72; var WizsideBarWidth=400; var WizmainURL = "https://wiz.medone.idf.il/MT//ICR/BOT.aspx?l=1153&profile=72"; var WizcloseText = "Are you sure you want to close ?"; if (WizsideBarPosition==1) WizuseSide="right"; function setAttrToElement(elem,attr,value) { if (typeof jQuery === 'undefined') { (elem.startsWith("#")) ? document.getElementById(elem.substring(1)).setAttribute(attr,value) : document.getElementsByClassName(elem.substring(1))[0].setAttribute(attr,value); } else { $(elem).attr(attr,value); } } function setEventActions(data) { switch (data) { case "1": setAttrToElement("#wizIframeInBox","src",WizchatServerName + "irchat.aspx?profile=" + wizProfile); break; case "0": var z=document.getElementById("wizIframeInBox").getAttribute("src"); if (z.toString().toLowerCase().indexOf("bot")==-1) setAttrToElement("#wizIframeInBox","src",WizmainURL + "&ran=" + Math.random() + "&T=" + WizcurrentToken); if (elemHasClass(".closeMode","openMode")) return false; break; } } window.addEventListener('message', event => { if (WizchatServerName.startsWith(event.origin)) { var data=event.data.split(":"); switch (data[0]) { case "getChatState" : setEventActions(data[1]); break; } } }); function sendIframeMessage(msg) { var frame = document.getElementById('wizChatChecker'); var ndSite=frame.getAttribute("src"); frame.contentWindow.postMessage(msg, ndSite); } function elemHasClass(elem,className) { if (typeof jQuery === 'undefined') { if (elem.startsWith("#")) { var t=document.getElementById(elem.substring(1)); return t[0].classList.contains(className); } else { var t=document.getElementsByClassName(elem.substring(1)); return t[0].classList.contains(className); } } else { return $(elem).hasClass(className); } } function ShowOrHide(elem,mode) { if (typeof jQuery === 'undefined') { if (mode=="show") { (elem.startsWith("#")) ? document.getElementById(elem.substring(1)).style.display='block' : document.getElementsByClassName(elem.substring(1))[0].style.display='block'; } else { (elem.startsWith("#")) ? document.getElementById(elem.substring(1)).style.display='none' : document.getElementsByClassName(elem.substring(1))[0].style.display='none'; } } else { (mode=="show") ? $(elem).show() : $(elem).hide(); } } function setFocusToElem(elem) { if (typeof jQuery === 'undefined') { (elem.startsWith("#")) ? document.getElementById(elem.substring(1)).focus : document.getElementsByClassName(elem.substring(1))[0].focus; } else { (mode=="show") ? $(elem).show() : $(elem).hide(); } } try { var canRunCoBrowse=0; } catch(e) {} var WizloadjQuery=1; var WizisMobile=false; var WizfloaterState = 0; // 0 close , 1 open //var Wizprofile = 1; var WizdocHeight=0; var WizdocWidth=0; function runCoBrowse() { canRunCoBrowse=1;} function setCBroom(data) {CBroom=data;} function WizGetCookie(cname) { var name = cname + "="; var decodedCookie = decodeURIComponent(document.cookie); var ca = decodedCookie.split(';'); for(var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; } function WizCheckForOpenCall(id) { if (!id) id=0; sendIframeMessage("getChatState:" + id); setTimeout(function () { if ($("#wizIframeInBox").attr("src")=="") setEventActions("0"); }, 1000); } function collapseChat(isCollapsed) {sendIframeMessage("collapseChat:" + isCollapsed);} function WizshowBar() { collapseChat('0'); if (elemHasClass(".WizcloseMode","WizopenMode")) return true; var id=""; try {id=WizGetCookie("userkey").split("=")[1];} catch (e) {} WizCheckForOpenCall(id); //show the bar with animate ShowOrHide(".WizdataArea","show"); if (typeof jQuery === 'undefined') { if (WizuseSide=="right") { document.getElementsByClassName("WizcloseMode")[0].style.right=WizsideBarWidth + "px !important"; } else { document.getElementsByClassName("WizcloseMode")[0].style.left=WizsideBarWidth + "px !important"; } ShowOrHide(".WizclosedSideCenter","hide"); setAttrToElement(".WizclosedSideBubble","aria-expanded","true"); //$('form').find(':input').filter(':visible:first').focus(); var element = document.getElementsByClassName("WizcloseMode")[0]; element.classList.add("WizopenMode"); } else { ShowOrHide(".WizclosedSideCenter","hide"); ShowOrHide(".WizcloseMode","show"); if (WizuseSide=="right") { $(".WizcloseMode").animate({ right: "0px" }, 500, function() { setAttrToElement(".WizclosedSideBubble","aria-expanded","true"); //$('#wizIframeInBox').contents().find('form').find(':input').filter(':visible:first').focus(); $(".WizcloseMode").addClass("WizopenMode"); }); } else { $(".WizcloseMode").animate({ left: "0px" }, 500, function() { setAttrToElement(".WizclosedSideBubble","aria-expanded","true"); //$('#wizIframeInBox').contents().find('form').find(':input').filter(':visible:first').focus(); $(".WizcloseMode").addClass("WizopenMode"); }); } } setAttrToElement("#wizChatChecker","src",WizchatServerName + "checkForNewMessages.aspx?profile=" + wizProfile); } function setTaps(mode) { if (mode=="1") { if ($("#WizagentTapping").length==0) { $(".WiztopBarTitle").append("
";
element.innerHTML=t;
}
}
function WizSetToken(token) {
WizcurrentToken=token;
//$("#wizIframeInBox").attr("src",WizchatServerName + "irchat.aspx?profile=" + wizProfile + "&t=" + token);
}
function WizminSideBar(closeMode) {
ShowOrHide('.Wizblanket',"hide");
setAttrToElement(".WizclosedSideBubble","aria-expanded","false");
collapseChat('1');
if (closeMode==undefined)setAttrToElement("#wizChatChecker","src",WizchatServerName + "checkForNewMessages.aspx?profile=" + wizProfile);
if (typeof jQuery === 'undefined') {
var element = document.getElementsByClassName("WizcloseMode")[0];
var a=0-element.style.width;
//setAttrToElement(".WizcloseMode","style",WizuseSide + ":0px");
ShowOrHide(".WizdataArea","hide");
element.classList.remove("WizopenMode");
ShowOrHide(".WizclosedSideCenter","show");
} else {
//var a=0-$(".WizcloseMode").width();
if (WizuseSide=="right") {
$(".WizcloseMode").animate({
right: -WizsideBarWidth,
}, 250, function() {
ShowOrHide(".WizdataArea","hide");
$(".WizcloseMode").removeClass("WizopenMode");
ShowOrHide(".WizclosedSideCenter","show");
});
} else {
$(".WizcloseMode").animate({
left : -WizsideBarWidth,
}, 250, function() {
ShowOrHide(".WizdataArea","hide");
$(".WizcloseMode").removeClass("WizopenMode");
ShowOrHide(".WizclosedSideCenter","show");
});
}
};
}
var Wizitem="
";
element.innerHTML=t;
}
}
function WizSetToken(token) {
WizcurrentToken=token;
//$("#wizIframeInBox").attr("src",WizchatServerName + "irchat.aspx?profile=" + wizProfile + "&t=" + token);
}
function WizminSideBar(closeMode) {
ShowOrHide('.Wizblanket',"hide");
setAttrToElement(".WizclosedSideBubble","aria-expanded","false");
collapseChat('1');
if (closeMode==undefined)setAttrToElement("#wizChatChecker","src",WizchatServerName + "checkForNewMessages.aspx?profile=" + wizProfile);
if (typeof jQuery === 'undefined') {
var element = document.getElementsByClassName("WizcloseMode")[0];
var a=0-element.style.width;
//setAttrToElement(".WizcloseMode","style",WizuseSide + ":0px");
ShowOrHide(".WizdataArea","hide");
element.classList.remove("WizopenMode");
ShowOrHide(".WizclosedSideCenter","show");
} else {
//var a=0-$(".WizcloseMode").width();
if (WizuseSide=="right") {
$(".WizcloseMode").animate({
right: -WizsideBarWidth,
}, 250, function() {
ShowOrHide(".WizdataArea","hide");
$(".WizcloseMode").removeClass("WizopenMode");
ShowOrHide(".WizclosedSideCenter","show");
});
} else {
$(".WizcloseMode").animate({
left : -WizsideBarWidth,
}, 250, function() {
ShowOrHide(".WizdataArea","hide");
$(".WizcloseMode").removeClass("WizopenMode");
ShowOrHide(".WizclosedSideCenter","show");
});
}
};
}
var Wizitem="